From 63e2edf9e848d95e60327ef66953ddc21cf3fbab Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 8 Dec 2023 12:38:51 +0100 Subject: [PATCH] luci-mod-network: properly reflect config state in sysfs tristates When a boolean sysfs option is forcibly set to `0` or `1` in uci, then make sure to properly reflect that choice state when rendering the widget. Right now the dropdown incorrectly reverted to "automatic" after saving but not applying the changes. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 4b6b00927b4a1076ed8bf23f3a0327a335ebece5) --- .../htdocs/luci-static/resources/tools/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js index 092bbbc14a..318373c7c7 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js @@ -198,7 +198,7 @@ var cbiFlagTristate = form.ListValue.extend({ this.vallist[0] = sysdef ? _('automatic (enabled)') : _('automatic (disabled)'); } - return this.super('renderWidget', [section_id, option_index, cfgvalue]); + return this.super('renderWidget', [section_id, option_index, cfgvalue ? cfgvalue + '!' : null]); } }); -- 2.30.2